package ops

import (
	"bufio"
	. "com.mgface.disobj/metanode/store"
)

//abnf规则]G<key.len> <key>
func Get(store Store, reader *bufio.Reader) (interface{}, error) {
	key, value, _ := readKeyAndValue(reader)
	return store.Get(key, value)
}

func Set(store Store, reader *bufio.Reader) error {
	key, value, e := readKeyAndValue(reader)
	store.Set(key, value)
	return e
}

func Del(store Store, reader *bufio.Reader) error {
	key, value, e := readKeyAndValue(reader)
	store.Del(key, value)
	return e
}
